home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIWebServiceProxy.idl < prev    next >
Text File  |  2006-05-08  |  13KB  |  327 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 2001
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   John Bandhauer (jband@netscape.com)
  24.  *   Vidur Apparao (vidur@netscape.com)
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  28.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsISupports.idl"
  41. #include "nsIWSDL.idl"
  42. #include "nsISimpleEnumerator.idl"
  43. #include "nsIException.idl"
  44. #include "nsISOAPResponse.idl"
  45. #include "nsISOAPBlock.idl"
  46. #include "nsIScriptableInterfaces.idl"
  47.  
  48. interface nsIWebServiceProxy;
  49. interface nsIWebServiceProxyCreationListener;
  50. interface nsIInterfaceInfo;
  51. interface nsIPropertyBag;
  52.  
  53. [scriptable, uuid(693611be-bb38-40e0-a98e-b46ff8a5bcca)]
  54. interface nsIWebServiceProxyFactory : nsISupports {
  55.   /**
  56.    * Create a service proxy. Loading of the WSDL URL will occur
  57.    * in a synchronous manner. Calls to web service can be made as
  58.    * soon as this method completes.
  59.    *
  60.    * @param wsdlURL The URL of the WSDL service description. This
  61.    *                description will be loaded and used as the basis
  62.    *                for the service proxy.
  63.    * @param portname The name of the port of the service that this 
  64.    *                 service proxy represents. Currently the port
  65.    *                 must represent a SOAP binding.
  66.    * @param qualifier The user-specified qualifier is incorporated into
  67.    *                  the names of XPCOM interfaces created for the 
  68.    *                  service proxy. For C++ callers, this qualifier 
  69.    *                  should be the  same one used in creating the IDL 
  70.    *                  used at compile time. Script callers need not 
  71.    *                  specify a qualifier.
  72.    * @param isAsync If PR_TRUE, the method signatures of the service
  73.    *                proxy represent an asynchronous calling convention.
  74.    *                A callback instance must be registered with the proxy.
  75.    *                A method call to a web service is only completed when
  76.    *                the corresponding callback method is invoked.
  77.    *                If PR_FALSE, the method signatures of the service
  78.    *                proxy represent a synchronous callling convention.
  79.    *                A method call to a web service is completed when the
  80.    *                method call to the proxy returns.
  81.    */
  82.   nsIWebServiceProxy createProxy(in AString wsdlURL, in AString portname, 
  83.                                  in AString qualifier, in boolean isAsync);
  84.  
  85.   /**
  86.    * Create a service proxy. Loading of the WSDL URL will occur
  87.    * in an asynchronous manner. Methods on the listener instance will
  88.    * be invoked when the proxy has been created. Any method invocations
  89.    * on the service proxy prior to asynchronous completion of the 
  90.    * intialization step will fail. The caller is guaranteed that this
  91.    * method will return before the listener is invoked.
  92.    *
  93.    * @param wsdlURL The URL of the WSDL service description. This
  94.    *                description will be loaded and used as the basis
  95.    *                for the service proxy.
  96.    * @param portname The name of the port of the service that this 
  97.    *                 service proxy represents. Currently the port
  98.    *                 must represent a SOAP binding.
  99.    * @param qualifier The user-specified qualifier is incorporated into
  100.    *                  the names of XPCOM interfaces created for the 
  101.    *                  service proxy. For C++ callers, this qualifier 
  102.    *                  should be the same one used in creating the IDL 
  103.    *                  used at compile time. Script callers need not 
  104.    *                  specify a qualifier.
  105.    * @param isAsync If PR_TRUE, the method signatures of the service
  106.    *                proxy represent an asynchronous calling convention.
  107.    *                A callback instance must be registered with the proxy.
  108.    *                A method call to a web service is only completed when
  109.    *                the corresponding callback method is invoked.
  110.    *                If PR_FALSE, the method signatures of the service
  111.    *                proxy represent a synchronous callling convention.
  112.    *                A method call to a web service is completed when the
  113.    *                method call to the proxy returns.
  114.    * @param listener The callback instance which will be invoked when
  115.    *                 the proxy is completely initialized.
  116.    */
  117.   void createProxyAsync(in AString wsdlURL, in AString portname, 
  118.                         in AString qualifier, in boolean isAsync,
  119.                         in nsIWebServiceProxyCreationListener listener);
  120. };
  121.  
  122. /**
  123.  * This interface should be implemented by a user who creates
  124.  * a web service proxy in an asynchronous manner. An instance
  125.  * of this interface is passed into the <code>initAsync</code>
  126.  * method of the proxy.
  127.  */
  128. [scriptable, uuid(a711250b-47da-4f16-a1fd-593de16375a1)]
  129. interface nsIWebServiceProxyCreationListener : nsISupports {
  130.   /**
  131.    * Invoked when the proxy is completely initialized. Method
  132.    * calls on the proxy can be made once this method is called.
  133.    * 
  134.    * @param proxy The initialized web service proxy
  135.    */
  136.   void onLoad(in nsIWebServiceProxy proxy);
  137.  
  138.   /**
  139.    * Invoked if an error occurs during web service proxy
  140.    * initialization. This error code be a result of attempting
  141.    * to load the specified WSDL URL or a result of processing
  142.    * the WSDL and creating the interface information for the 
  143.    * proxy.
  144.    *
  145.    * @param error The exception generated as a result of the
  146.    *                  error. This object can be introspected
  147.    *                  for further information.
  148.    */ 
  149.   void onError(in nsIException error);
  150. };
  151.  
  152. [scriptable, uuid(2122421c-1326-41db-87f8-25519d8a12cb)]
  153. interface nsIWebServiceProxy : nsISupports {
  154.   
  155.   [noscript] void Init(in nsIWSDLPort aPort, 
  156.                        in nsIInterfaceInfo aPrimaryInterface,
  157.                        in nsIInterfaceInfoManager aInterfaceInfoManager,
  158.                        in AString aQualifier,
  159.                        in boolean aIsAsync);
  160.  
  161.   /**
  162.    * The WSDL port that this service proxy represents.
  163.    *
  164.    * @see nsIWSDLPort
  165.    */
  166.   readonly attribute nsIWSDLPort port;
  167.  
  168.   /**
  169.    * PR_TRUE if the service proxy methods represent an asynchronous
  170.    * calling convention. PR_FALSE if the methods are synchronous.
  171.    */
  172.   readonly attribute boolean isAsync;
  173.  
  174.   /**
  175.    * The qualifier used for interface names related to
  176.    * this service proxy.
  177.    */
  178.   readonly attribute AString qualifier;
  179.  
  180.   /**
  181.    * An enumerator that returns the set of pending calls for the
  182.    * service proxy. Each call is an instance of the 
  183.    * <code>nsIWebServiceCallContext</code> interface.
  184.    *
  185.    * @see nsIWebServiceCallContext
  186.    */
  187.   readonly attribute nsISimpleEnumerator pendingCalls;  
  188.   
  189.   /**
  190.    * The name of the primary interface for this proxy. This may or may not be
  191.    * the async version depending on whether or not this is an async proxy.
  192.    */
  193.   readonly attribute string primaryInterfaceName;
  194.   
  195.   /**
  196.    * The name of the primary async listener interface for this proxy. 
  197.    * This will be null if this is not an async proxy.
  198.    */
  199.   readonly attribute string primaryAsyncListenerInterfaceName;
  200.  
  201.   /**
  202.    * The collection of interfaces related to this service proxy. This
  203.    * will include the primary interface implemented by the service
  204.    * proxy as well as any listener or complex type interfaces required
  205.    * for method parameters and return values.
  206.    * NOTE: only interesting from JavaScript.
  207.    */
  208.   readonly attribute nsIScriptableInterfaces interfaces;
  209. };
  210.  
  211.  
  212. /**
  213.  * A representation of a method invocation on a web service.
  214.  * An instance of this interface is returned as a result of making
  215.  * an asynchronous call and can be queried for status of the
  216.  * call.
  217.  */
  218. [scriptable, uuid(87d87900-f102-4a15-b345-7b77a49d2df2)]
  219. interface nsIWebServiceCallContext : nsISupports {
  220.   
  221.   /** 
  222.    * Possible values of the <code>status</code> attribute. A pending
  223.    * call has a status of PENDING. A completed call has a status of
  224.    * SUCCEEDED or FAILED depending on the result of the call.
  225.    */
  226.   const PRUint32 PENDING = 0;
  227.   const PRUint32 SUCCEEDED = 1;
  228.   const PRUint32 FAILED = 2;
  229.   const PRUint32 ABORTED = 3;
  230.  
  231.   /**
  232.    * The proxy object on which the call was made.
  233.    * 
  234.    * @see nsIWebServiceProxy
  235.    */
  236.   readonly attribute nsIWebServiceProxy proxy;
  237.  
  238.   /**
  239.    * The name of the method that was invoked.
  240.    */
  241.   readonly attribute AString methodName;
  242.  
  243.   /**
  244.    * The status of the call, whether pending, completed successfully
  245.    * or completed with a fault.
  246.    */
  247.   readonly attribute PRUint32 status;
  248.  
  249.   /**
  250.    * The exception generated by the call if the status is FAILURE.
  251.    * The exception object can be introspected for more information.
  252.    * The <code>data</code> member can be QIed to a 
  253.    * <code>nsISOAPFault</code> instance for calls that use a
  254.    * SOAP binding.
  255.    */ 
  256.   readonly attribute nsIException pendingException;
  257.  
  258.   /**
  259.    * The WSDL operation that correpsonds to the method being invoked.
  260.    *
  261.    * @see nsIWSDLOperation
  262.    */
  263.   readonly attribute nsIWSDLOperation operation;
  264.  
  265.   /**
  266.    * Called to abort a pending call. If the call is still pending,
  267.    * its callback instance's <code>onError</code> will be invoked,
  268.    * passing in the specified exception.
  269.    *
  270.    * @param error The exception passed to the callback instance's
  271.    *              <code>onError</code> method.
  272.    */
  273.   void abort(in nsIException error);
  274. };
  275.  
  276. [scriptable, uuid(1ef83ece-b645-4b55-a501-df42c3333b47)]
  277. interface nsIWebServiceSOAPCallContext : nsIWebServiceCallContext {
  278.   /**
  279.    * For users who want access to the lower-level constructs that
  280.    * are used for the method invocation, this attributes provides
  281.    * the SOAP response once the call has completed.
  282.    *
  283.    * @see nsISOAPResponse
  284.    */
  285.   readonly attribute nsISOAPResponse soapResponse;
  286. };
  287.  
  288. [uuid(b16b15bc-bfad-43cf-b374-2e4651acbc3c)]
  289. interface nsIWebServiceComplexTypeWrapper : nsISupports {
  290.   void Init(in nsISupports aComplexTypeInstance,
  291.             in nsIInterfaceInfo aInterfaceInfo);
  292. };
  293.  
  294. [uuid(e0b1765e-c0be-4a28-aca3-b292c5c3788b)]
  295. interface nsIWebServicePropertyBagWrapper : nsISupports {
  296.   void Init(in nsIPropertyBag aPropertyBag,
  297.             in nsIInterfaceInfo aInterfaceInfo);
  298. };
  299.  
  300. %{ C++
  301.  
  302. #define NS_WEBSERVICEPROXYFACTORY_CLASSID           \
  303. { /* 4E557E69-CCE0-47da-A7D3-2A7ED666F566 */        \
  304.  0x4e557e69, 0xcce0, 0x47da,                        \
  305.  {0xa7, 0xd3, 0x2a, 0x7e, 0xd6, 0x66, 0xf5, 0x66}}
  306. #define NS_WEBSERVICEPROXYFACTORY_CONTRACTID "@mozilla.org/xmlextras/proxy/webserviceproxyfactory;1"
  307.  
  308. #define NS_WEBSERVICEPROXY_CLASSID                  \
  309. { /* 1220efd4-8018-45b0-bfc1-0c0716ee0bfb */        \
  310.  0x1220efd4, 0x8018, 0x45b0,                        \
  311.  {0xbf, 0xc1, 0x0c, 0x07, 0x16, 0xee, 0x0b, 0xfb}}
  312. #define NS_WEBSERVICEPROXY_CONTRACTID "@mozilla.org/xmlextras/proxy/webserviceproxy;1"
  313.  
  314. #define NS_WEBSERVICECOMPLEXTYPEWRAPPER_CLASSID     \
  315. { /* 615272eb-3908-4fcc-b8f6-94d5a146e2bc */        \
  316.  0x615272eb, 0x3908, 0x4fcc,                        \
  317.  {0xb8, 0xf6, 0x94, 0xd5, 0xa1, 0x46, 0xe2, 0xbc}}
  318. #define NS_WEBSERVICECOMPLEXTYPEWRAPPER_CONTRACTID "@mozilla.org/xmlextras/proxy/webservicecomplextypewrapper;1"
  319.  
  320. #define NS_WEBSERVICEPROPERTYBAGWRAPPER_CLASSID     \
  321. { /* 1c76aea3-0810-45b7-bce9-03abc209eb8c */        \
  322.  0x1c76aea3, 0x0810, 0x45b7,                        \
  323.  {0xbc, 0xe9, 0x03, 0xab, 0xc2, 0x09, 0xeb, 0x8c}} 
  324. #define NS_WEBSERVICEPROPERTYBAGWRAPPER_CONTRACTID "@mozilla.org/xmlextras/proxy/webservicepropertybagwrapper;1"
  325.  
  326. %} 
  327.